astyle jeeps included files (#1219)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Wed, 15 Nov 2023 18:29:55 +0000 (11:29 -0700)
committerGitHub <noreply@github.com>
Wed, 15 Nov 2023 18:29:55 +0000 (11:29 -0700)
jeeps/gps.h
jeeps/gpsapp.h
jeeps/gpscom.h
jeeps/gpsdevice.h
jeeps/gpsfmt.h
jeeps/gpsmem.h
jeeps/gpsprot.h
jeeps/gpsread.h
jeeps/gpssend.h
jeeps/gpsutil.h

index 7dd742c2a1975dd2d8c74f77e2b1aa8a91e50a5e..f883911f34d39d7e3c91de85c2430becbeb95cdf 100644 (file)
@@ -31,7 +31,7 @@ extern char gps_categories[16][17];
 struct GPS_Packet {
   US type{0};
   uint32_t n{0};
-  UC data[MAX_GPS_PACKET_SIZE]{};
+  UC data[MAX_GPS_PACKET_SIZE] {};
 };
 
 
@@ -154,16 +154,16 @@ typedef struct GPS_SWay {
  * Forerunner/Edge Lap data.
  */
 typedef struct GPS_SLap {
-       uint32_t index; /* unique index in device or -1 */
+  uint32_t index; /* unique index in device or -1 */
   time_t       start_time;
-       uint32_t total_time;    /* Hundredths of a second */
+  uint32_t total_time; /* Hundredths of a second */
   float        total_distance; /* In meters */
   double       begin_lat;
   double       begin_lon;
   double       end_lat;
   double       end_lon;
-       int16_t calories;
-       uint32_t track_index; /* ref to track or -1 */
+  int16_t calories;
+  uint32_t track_index; /* ref to track or -1 */
   float max_speed; /* In meters per second */
   unsigned char avg_heart_rate; /* In beats-per-minute, 0 if invalid */
   unsigned char max_heart_rate; /* In beats-per-minute, 0 if invalid */
@@ -179,17 +179,17 @@ typedef struct GPS_SLap {
 
 
 typedef struct GPS_SCourse {
-       uint32_t index;                    /* Unique among courses on device */
+  uint32_t index;                    /* Unique among courses on device */
   char      course_name[16];          /* Null-terminated unique course name */
-       uint32_t track_index;              /* Index of the associated track
+  uint32_t track_index;              /* Index of the associated track
                                          * Must be 0xFFFFFFFF if there is none*/
 } GPS_OCourse, *GPS_PCourse;
 
 
 typedef struct GPS_SCourse_Lap {
-       uint32_t course_index;         /* Index of associated course */
-       uint32_t lap_index;            /* This lap's index in the course */
-       uint32_t total_time;           /* In hundredths of a second */
+  uint32_t course_index;         /* Index of associated course */
+  uint32_t lap_index;            /* This lap's index in the course */
+  uint32_t total_time;           /* In hundredths of a second */
   float         total_dist;           /* [m] */
   double        begin_lat;            /* Starting position of the lap */
   double        begin_lon;            /* Invalid if lat,lon are 0x7FFFFFFF.*/
@@ -225,9 +225,9 @@ typedef struct GPS_SCourse_Point {
 } GPS_OCourse_Point, *GPS_PCourse_Point;
 
 typedef struct GPS_SCourse_Limits {
-       int32_t max_courses;
-       int32_t max_course_laps;
-       int32_t max_course_pnt;
+  int32_t max_courses;
+  int32_t max_course_laps;
+  int32_t max_course_pnt;
   int32_t max_course_trk_pnt;
 } GPS_OCourse_Limits, *GPS_PCourse_Limits;
 
index 00f2736bb5605ada8ef40571f3406a816c6db122..52d4ee52f9af8e6dc3bc449f27fa590bc4c9badc 100644 (file)
@@ -22,17 +22,17 @@ int32_t GPS_A301_Send(const char* port, GPS_PTrack* trk, int32_t n, int protoid,
                       gpsdevh* fd);
 
 int32_t GPS_D300_Get(GPS_PTrack* trk, int32_t entries, gpsdevh* h);
-  void   GPS_D300b_Get(GPS_PTrack* trk, UC* data);
-  void   GPS_D301b_Get(GPS_PTrack* trk, UC* data);
-  void   GPS_D302b_Get(GPS_PTrack* trk, UC* data);
-  void   GPS_D303b_Get(GPS_PTrack* trk, UC* data); /*D304*/
-  void   GPS_D310_Get(GPS_PTrack* trk, UC* s);
-  void   GPS_D311_Get(GPS_PTrack* trk, UC* s);
-  void   GPS_D300_Send(UC* data, GPS_PTrack trk, int32_t* len);
-  void   GPS_D301_Send(UC* data, GPS_PTrack trk, int32_t* len, int type);
-  void   GPS_D303_Send(UC* data, GPS_PTrack trk, int32_t* len, int protoid);
-  void   GPS_D310_Send(UC* data, GPS_PTrack trk, int32_t* len);
-  void   GPS_D311_Send(UC* data, GPS_PTrack trk, int32_t* len);
+void   GPS_D300b_Get(GPS_PTrack* trk, UC* data);
+void   GPS_D301b_Get(GPS_PTrack* trk, UC* data);
+void   GPS_D302b_Get(GPS_PTrack* trk, UC* data);
+void   GPS_D303b_Get(GPS_PTrack* trk, UC* data); /*D304*/
+void   GPS_D310_Get(GPS_PTrack* trk, UC* s);
+void   GPS_D311_Get(GPS_PTrack* trk, UC* s);
+void   GPS_D300_Send(UC* data, GPS_PTrack trk, int32_t* len);
+void   GPS_D301_Send(UC* data, GPS_PTrack trk, int32_t* len, int type);
+void   GPS_D303_Send(UC* data, GPS_PTrack trk, int32_t* len, int protoid);
+void   GPS_D310_Send(UC* data, GPS_PTrack trk, int32_t* len);
+void   GPS_D311_Send(UC* data, GPS_PTrack trk, int32_t* len);
 
 int32_t GPS_A400_Get(const char* port, GPS_PWay** way);
 int32_t GPS_A400_Send(const char* port, GPS_PWay* way, int32_t n);
@@ -40,76 +40,76 @@ int32_t GPS_A400_Send(const char* port, GPS_PWay* way, int32_t n);
 int32_t GPS_A500_Get(const char* port, GPS_PAlmanac** alm);
 int32_t GPS_A500_Send(const char* port, GPS_PAlmanac* alm, int32_t n);
 
-  time_t GPS_A600_Get(const char* port);
-  time_t GPS_D600_Get(const GPS_Packet& packet);
+time_t GPS_A600_Get(const char* port);
+time_t GPS_D600_Get(const GPS_Packet& packet);
 int32_t GPS_A600_Send(const char* port, time_t Time);
-  void   GPS_D600_Send(GPS_Packet& packet, time_t Time);
+void   GPS_D600_Send(GPS_Packet& packet, time_t Time);
 
 int32_t GPS_A700_Get(const char* port, double* lat, double* lon);
 int32_t GPS_A700_Send(const char* port, double lat, double lon);
-  void   GPS_D700_Get(const GPS_Packet& packet, double* lat, double* lon);
-  void   GPS_D700_Send(GPS_Packet& packet, double lat, double lon);
+void   GPS_D700_Get(const GPS_Packet& packet, double* lat, double* lon);
+void   GPS_D700_Send(GPS_Packet& packet, double lat, double lon);
 
 int32_t GPS_A800_On(const char* port, gpsdevh** fd);
 int32_t GPS_A800_Off(const char* port, gpsdevh** fd);
 int32_t GPS_A800_Get(gpsdevh** fd, GPS_PPvt_Data* packet);
-  void   GPS_D800_Get(const GPS_Packet& packet, GPS_PPvt_Data* pvt);
+void   GPS_D800_Get(const GPS_Packet& packet, GPS_PPvt_Data* pvt);
 
 int32_t GPS_A906_Get(const char* port, GPS_PLap** lap, pcb_fn cb);
-  void   GPS_D1011b_Get(GPS_PLap* Lap,UC* data); /*D906 D1001 D1015*/
+void   GPS_D1011b_Get(GPS_PLap* Lap,UC* data); /*D906 D1001 D1015*/
 
 int32_t GPS_A1006_Get(const char* port, GPS_PCourse** crs, pcb_fn cb);
 int32_t GPS_A1006_Send(const char* port, GPS_PCourse* crs, int32_t n_crs,
                        gpsdevh* fd);
-  void   GPS_D1006_Get(GPS_PCourse* crs, UC* p);
-  void   GPS_D1006_Send(UC* data, GPS_PCourse crs, int32_t* len);
+void   GPS_D1006_Get(GPS_PCourse* crs, UC* p);
+void   GPS_D1006_Send(UC* data, GPS_PCourse crs, int32_t* len);
 
 int32_t GPS_A1007_Get(const char* port, GPS_PCourse_Lap** clp, pcb_fn cb);
 int32_t GPS_A1007_Send(const char* port, GPS_PCourse_Lap* clp, int32_t n_clp,
                        gpsdevh* fd);
-  void   GPS_D1007_Get(GPS_PCourse_Lap* clp, UC* p);
-  void   GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32_t* len);
+void   GPS_D1007_Get(GPS_PCourse_Lap* clp, UC* p);
+void   GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32_t* len);
 
 int32_t GPS_A1008_Get(const char* port, GPS_PCourse_Point** cpt, pcb_fn cb);
 int32_t GPS_A1008_Send(const char* port, GPS_PCourse_Point* cpt, int32_t n_cpt,
                        gpsdevh* fd);
-  void   GPS_D1012_Get(GPS_PCourse_Point* cpt, UC* p);
-  void   GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32_t* len);
+void   GPS_D1012_Get(GPS_PCourse_Point* cpt, UC* p);
+void   GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32_t* len);
 
 int32_t GPS_A1009_Get(const char* port, GPS_PCourse_Limits limits);
-  void   GPS_D1013_Get(GPS_PCourse_Limits limits, UC* p);
-
-  /* Unhandled documented protocols, as of:
-    Garmin Device Interface Specification, May 19, 2006, Drawing Number: 001-00063-00 Rev. C
-  A650  FlightBook Transfer Protocol
-  A1000  Run Transfer Protocol
-       Capability A1000: D1009
-               D1000 D1010
-  A1002  Workout Transfer Protocol
-       Capability A1002: D1008
-               D1002
-       Capability A1003: D1003
-  A1004  Fitness User Profile Transfer Protocol
-       Capability A1004: D1004
-  A1005  Workout Limits Transfer Protocol
-       Capability A1005: D1005
-  */
-  /* Unimplemented and Undocumented, as listed from the following device/sw:
-       GF305 3.70
-
-  Capability A601: D601
-  Capability A801: D801
-
-  Capability A902:
-  Capability A903:
-  Capability A907: D907 D908 D909 D910
-  Capability A918: D918
-  Capability A1013: D1014
-  */
-
-  const char* Get_Pkt_Type(US p, US d0, const char** xinfo);
-
-  void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32_t* n);
+void   GPS_D1013_Get(GPS_PCourse_Limits limits, UC* p);
+
+/* Unhandled documented protocols, as of:
+  Garmin Device Interface Specification, May 19, 2006, Drawing Number: 001-00063-00 Rev. C
+A650  FlightBook Transfer Protocol
+A1000  Run Transfer Protocol
+       Capability A1000: D1009
+               D1000 D1010
+A1002  Workout Transfer Protocol
+       Capability A1002: D1008
+               D1002
+       Capability A1003: D1003
+A1004  Fitness User Profile Transfer Protocol
+       Capability A1004: D1004
+A1005  Workout Limits Transfer Protocol
+       Capability A1005: D1005
+*/
+/* Unimplemented and Undocumented, as listed from the following device/sw:
+       GF305 3.70
+
+Capability A601: D601
+Capability A801: D801
+
+Capability A902:
+Capability A903:
+Capability A907: D907 D908 D909 D910
+Capability A918: D918
+Capability A1013: D1014
+*/
+
+const char* Get_Pkt_Type(US p, US d0, const char** xinfo);
+
+void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32_t* n);
 int32_t GPS_Set_Baud_Rate(const char* port, int br);
 
 #endif // JEEPS_GPSAPP_H_INCLUDED_
index 88f7f6c6903c860da070caf8e77a6618e2cd57fc..bb34cb81f676b2137b5ee5500ebe6c9e59bc835a 100644 (file)
@@ -7,7 +7,7 @@
 
 int32_t GPS_Command_Off(const char* port);
 
-  time_t GPS_Command_Get_Time(const char* port);
+time_t GPS_Command_Get_Time(const char* port);
 int32_t GPS_Command_Send_Time(const char* port, time_t Time);
 
 int32_t GPS_Command_Get_Position(const char* port, double* lat, double* lon);
@@ -38,7 +38,7 @@ int32_t GPS_Command_Send_Course(const char* port, GPS_PCourse* crs, GPS_PCourse_
                                 GPS_PTrack* trk, GPS_PCourse_Point* cpt,
                                 int32_t n_crs, int32_t n_clp, int32_t n_trk, int32_t n_cpt);
 int32_t GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32_t n_trk,
-                                         GPS_PWay* wpt, int32_t n_wpt, int eraset);
+    GPS_PWay* wpt, int32_t n_wpt, int eraset);
 
 int32_t GPS_Command_Get_Workout(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
 int32_t GPS_Command_Get_Fitness_User_Profile(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
index 444e869a6f4e256086069257172f55bb89a074ae..757acb14db1cd2c8e0bca14f22e052edc5366953 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef JEEPS_GPSDEVICE_H_INCLUDED_
 #define JEEPS_GPSDEVICE_H_INCLUDED_
 
-  typedef struct gpsdevh gpsdevh;
+typedef struct gpsdevh gpsdevh;
 
 #include "jeeps/gps.h"
 
@@ -36,28 +36,28 @@ int32_t GPS_Device_Wait(gpsdevh* fd);
 int32_t GPS_Device_Flush(gpsdevh* fd);
 int32_t GPS_Device_Read(int32_t ignored, void* ibuf, int size);
 int32_t GPS_Device_Write(int32_t ignored, const void* obuf, int size);
-  void   GPS_Device_Error(char* hdr, ...);
+void   GPS_Device_Error(char* hdr, ...);
 int32_t GPS_Write_Packet(gpsdevh* fd, const GPS_Packet& packet);
-  bool   GPS_Send_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
+bool   GPS_Send_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
 int32_t GPS_Packet_Read(gpsdevh* fd, GPS_Packet* packet);
-  bool   GPS_Get_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
-
-  using gps_device_op = int32_t (*)(gpsdevh*);
-  using gps_device_op5 = int32_t (*)(const char*, gpsdevh** fd);
-  using gps_device_op10 = bool (*)(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
-  using gps_device_op12 = int32_t (*)(gpsdevh* fd, const GPS_Packet& packet);
-  using gps_device_op13 = int32_t (*)(gpsdevh* fd, GPS_Packet* packet);
-
-  typedef struct {
-    gps_device_op5 Device_On;
-    gps_device_op Device_Off;
-    gps_device_op Device_Chars_Ready;
-    gps_device_op Device_Wait;
-    gps_device_op Device_Flush;
-    gps_device_op10 Send_Ack;
-    gps_device_op10 Get_Ack;
-    gps_device_op13 Read_Packet;
-    gps_device_op12 Write_Packet;
-  } gps_device_ops;
+bool   GPS_Get_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
+
+using gps_device_op = int32_t (*)(gpsdevh*);
+using gps_device_op5 = int32_t (*)(const char*, gpsdevh** fd);
+using gps_device_op10 = bool (*)(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
+using gps_device_op12 = int32_t (*)(gpsdevh* fd, const GPS_Packet& packet);
+using gps_device_op13 = int32_t (*)(gpsdevh* fd, GPS_Packet* packet);
+
+typedef struct {
+  gps_device_op5 Device_On;
+  gps_device_op Device_Off;
+  gps_device_op Device_Chars_Ready;
+  gps_device_op Device_Wait;
+  gps_device_op Device_Flush;
+  gps_device_op10 Send_Ack;
+  gps_device_op10 Get_Ack;
+  gps_device_op13 Read_Packet;
+  gps_device_op12 Write_Packet;
+} gps_device_ops;
 
 #endif /* JEEPS_GPSDEVICE_H_INCLUDED_ */
index 9471eb3f429b4eaefe33c8858b942257eeb0d988..8b0d3a8ff6b339e461ddc2234e5e5fa19b66b727 100644 (file)
@@ -6,11 +6,11 @@
 #include <cstdio>
 #include <ctime>
 
-  void   GPS_Fmt_Print_Time(time_t Time, FILE* outf);
-  void   GPS_Fmt_Print_Position(double lat, double lon, FILE* outf);
-  void   GPS_Fmt_Print_Pvt(GPS_PPvt_Data pvt, FILE* outf);
-  void   GPS_Fmt_Print_Almanac(GPS_PAlmanac* alm, int32_t n, FILE* outf);
-  void   GPS_Fmt_Print_Track(GPS_PTrack* trk, int32_t n, FILE* outf);
+void   GPS_Fmt_Print_Time(time_t Time, FILE* outf);
+void   GPS_Fmt_Print_Position(double lat, double lon, FILE* outf);
+void   GPS_Fmt_Print_Pvt(GPS_PPvt_Data pvt, FILE* outf);
+void   GPS_Fmt_Print_Almanac(GPS_PAlmanac* alm, int32_t n, FILE* outf);
+void   GPS_Fmt_Print_Track(GPS_PTrack* trk, int32_t n, FILE* outf);
 int32_t GPS_Fmt_Print_Waypoint(GPS_PWay* way, int32_t n, FILE* outf);
 int32_t GPS_Fmt_Print_Proximity(GPS_PWay* way, int32_t n, FILE* outf);
 int32_t GPS_Fmt_Print_Route(GPS_PWay* way, int32_t n, FILE* outf);
index 2d9fe6588ea024c446048100cf667db3a8c637ad..1e249483b6379d9e52eab5b37cf4dc68a94113c3 100644 (file)
@@ -5,21 +5,21 @@ constexpr double GPS_FLTMIN = 1.75494351E-38;
 constexpr double GPS_FLTMAX = 3.402823466E+38;
 
 #include "jeeps/gps.h"
-  GPS_PPvt_Data     GPS_Pvt_New();
-  void              GPS_Pvt_Del(GPS_PPvt_Data* thys);
-  GPS_PAlmanac      GPS_Almanac_New();
-  void              GPS_Almanac_Del(GPS_PAlmanac* thys);
-  GPS_PTrack        GPS_Track_New();
-  void              GPS_Track_Del(GPS_PTrack* thys);
-  GPS_PWay          GPS_Way_New();
-  void              GPS_Way_Del(GPS_PWay* thys);
-  GPS_PLap          GPS_Lap_New();
-  void              GPS_Lap_Del(GPS_PLap* thys);
-  GPS_PCourse       GPS_Course_New();
-  void              GPS_Course_Del(GPS_PCourse* thys);
-  GPS_PCourse_Lap   GPS_Course_Lap_New();
-  void              GPS_Course_Lap_Del(GPS_PCourse_Lap* thys);
-  GPS_PCourse_Point GPS_Course_Point_New();
-  void              GPS_Course_Point_Del(GPS_PCourse_Point* thys);
+GPS_PPvt_Data     GPS_Pvt_New();
+void              GPS_Pvt_Del(GPS_PPvt_Data* thys);
+GPS_PAlmanac      GPS_Almanac_New();
+void              GPS_Almanac_Del(GPS_PAlmanac* thys);
+GPS_PTrack        GPS_Track_New();
+void              GPS_Track_Del(GPS_PTrack* thys);
+GPS_PWay          GPS_Way_New();
+void              GPS_Way_Del(GPS_PWay* thys);
+GPS_PLap          GPS_Lap_New();
+void              GPS_Lap_Del(GPS_PLap* thys);
+GPS_PCourse       GPS_Course_New();
+void              GPS_Course_Del(GPS_PCourse* thys);
+GPS_PCourse_Lap   GPS_Course_Lap_New();
+void              GPS_Course_Lap_Del(GPS_PCourse_Lap* thys);
+GPS_PCourse_Point GPS_Course_Point_New();
+void              GPS_Course_Point_Del(GPS_PCourse_Point* thys);
 
 #endif // JEEPS_GPSMEM_H_INCLUDED_
index 12d45b55df1d19dfcf0e01bb887da3c4e7b8df20..2a296a6c6bbe83836679fbc7a61782f8164794db 100644 (file)
 
 #include "jeeps/gps.h"
 
-  /*
  *  Link protocols
  */
-
-  struct LINKDATA {
-    US Pid_Protocol_Array;
-    US Pid_Product_Rqst;
-    US Pid_Product_Data;
-    US Pid_Ext_Product_Data;
-
-    US Pid_Ack_Byte;
-    US Pid_Command_Data;
-    US Pid_Xfer_Cmplt;
-    US Pid_Date_Time_Data;
-    US Pid_Position_Data;
-    US Pid_Prx_Wpt_Data;
-    US Pid_Nak_Byte;
-    US Pid_Records;
-    US Pid_Rte_Hdr;
-    US Pid_Rte_Wpt_Data;
-    US Pid_Almanac_Data;
-    US Pid_Trk_Data;
-    US Pid_Wpt_Data;
-    US Pid_Pvt_Data;
-    US Pid_Rte_Link_Data;
-    US Pid_Trk_Hdr;
-
-    US Pid_FlightBook_Record;
-    US Pid_Lap;
-    US Pid_Wpt_Cat;
-    US Pid_Run;
-    US Pid_Workout;
-    US Pid_Workout_Occurrence;
-    US Pid_Fitness_User_Profile;
-    US Pid_Workout_Limits;
-    US Pid_Course;
-    US Pid_Course_Lap;
-    US Pid_Course_Point;
-    US Pid_Course_Trk_Hdr;
-    US Pid_Course_Trk_Data;
-    US Pid_Course_Limits;
-    US Pid_Trk2_Hdr; /*Undocumented*/
-  };
-
-
-
-
-
-  /*
  * Command types
  */
+/*
+ *  Link protocols
+ */
+
+struct LINKDATA {
+  US Pid_Protocol_Array;
+  US Pid_Product_Rqst;
+  US Pid_Product_Data;
+  US Pid_Ext_Product_Data;
+
+  US Pid_Ack_Byte;
+  US Pid_Command_Data;
+  US Pid_Xfer_Cmplt;
+  US Pid_Date_Time_Data;
+  US Pid_Position_Data;
+  US Pid_Prx_Wpt_Data;
+  US Pid_Nak_Byte;
+  US Pid_Records;
+  US Pid_Rte_Hdr;
+  US Pid_Rte_Wpt_Data;
+  US Pid_Almanac_Data;
+  US Pid_Trk_Data;
+  US Pid_Wpt_Data;
+  US Pid_Pvt_Data;
+  US Pid_Rte_Link_Data;
+  US Pid_Trk_Hdr;
+
+  US Pid_FlightBook_Record;
+  US Pid_Lap;
+  US Pid_Wpt_Cat;
+  US Pid_Run;
+  US Pid_Workout;
+  US Pid_Workout_Occurrence;
+  US Pid_Fitness_User_Profile;
+  US Pid_Workout_Limits;
+  US Pid_Course;
+  US Pid_Course_Lap;
+  US Pid_Course_Point;
+  US Pid_Course_Trk_Hdr;
+  US Pid_Course_Trk_Data;
+  US Pid_Course_Limits;
+  US Pid_Trk2_Hdr; /*Undocumented*/
+};
+
+
+
+
+
+/*
+ * Command types
+ */
 
 #define pA010 10
 #define pA011 11
 
-  COMMON int32_t gps_device_command;
-
-
-  struct COMMANDDATA {
-    US Cmnd_Abort_Transfer;
-    US Cmnd_Transfer_Alm;
-    US Cmnd_Transfer_Posn;
-    US Cmnd_Transfer_Prx;
-    US Cmnd_Transfer_Rte;
-    US Cmnd_Transfer_Time;
-    US Cmnd_Transfer_Trk;
-    US Cmnd_Transfer_Wpt;
-    US Cmnd_Turn_Off_Pwr;
-    US Cmnd_Start_Pvt_Data;
-    US Cmnd_Stop_Pvt_Data;
-    US Cmnd_FlightBook_Transfer;
-    US Cmnd_Transfer_Laps;
-    US Cmnd_Transfer_Wpt_Cats;
-    US Cmnd_Transfer_Runs;
-    US Cmnd_Transfer_Workouts;
-    US Cmnd_Transfer_Workout_Occurrences;
-    US Cmnd_Transfer_Fitness_User_Profile;
-    US Cmnd_Transfer_Workout_Limits;
-    US Cmnd_Transfer_Courses;
-    US Cmnd_Transfer_Course_Laps;
-    US Cmnd_Transfer_Course_Points;
-    US Cmnd_Transfer_Course_Tracks;
-    US Cmnd_Transfer_Course_Limits;
-  };
-
-
-
-
-  /*
  * Waypoint Transfer Protocol
  */
+COMMON int32_t gps_device_command;
+
+
+struct COMMANDDATA {
+  US Cmnd_Abort_Transfer;
+  US Cmnd_Transfer_Alm;
+  US Cmnd_Transfer_Posn;
+  US Cmnd_Transfer_Prx;
+  US Cmnd_Transfer_Rte;
+  US Cmnd_Transfer_Time;
+  US Cmnd_Transfer_Trk;
+  US Cmnd_Transfer_Wpt;
+  US Cmnd_Turn_Off_Pwr;
+  US Cmnd_Start_Pvt_Data;
+  US Cmnd_Stop_Pvt_Data;
+  US Cmnd_FlightBook_Transfer;
+  US Cmnd_Transfer_Laps;
+  US Cmnd_Transfer_Wpt_Cats;
+  US Cmnd_Transfer_Runs;
+  US Cmnd_Transfer_Workouts;
+  US Cmnd_Transfer_Workout_Occurrences;
+  US Cmnd_Transfer_Fitness_User_Profile;
+  US Cmnd_Transfer_Workout_Limits;
+  US Cmnd_Transfer_Courses;
+  US Cmnd_Transfer_Course_Laps;
+  US Cmnd_Transfer_Course_Points;
+  US Cmnd_Transfer_Course_Tracks;
+  US Cmnd_Transfer_Course_Limits;
+};
+
+
+
+
+/*
+ * Waypoint Transfer Protocol
+ */
 #define pA100 100
-  COMMON int32_t gps_waypt_transfer;
+COMMON int32_t gps_waypt_transfer;
 
-  /*
  * Waypoint category transfer protocol
  */
+/*
+ * Waypoint category transfer protocol
+ */
 #define pA101 101
-  COMMON int32_t gps_category_transfer;
+COMMON int32_t gps_category_transfer;
 
-  /*
  * Route Transfer Protocol
  */
+/*
+ * Route Transfer Protocol
+ */
 #define pA200 200
 #define pA201 201
-  COMMON int32_t gps_route_transfer;
+COMMON int32_t gps_route_transfer;
 
-  /*
  * Track Log Transfer Protocol
  */
+/*
+ * Track Log Transfer Protocol
+ */
 #define pA300 300
 #define pA301 301
 #define pA302 302
 #define pA304 304
-  COMMON int32_t gps_trk_transfer;
+COMMON int32_t gps_trk_transfer;
 
-  /*
  *  Proximity Waypoint Transfer Protocol
  */
+/*
+ *  Proximity Waypoint Transfer Protocol
+ */
 #define pA400 400
-  COMMON int32_t gps_prx_waypt_transfer;
+COMMON int32_t gps_prx_waypt_transfer;
 
-  /*
  *  Almanac Transfer Protocol
  */
+/*
+ *  Almanac Transfer Protocol
+ */
 #define pA500 500
-  COMMON int32_t gps_almanac_transfer;
+COMMON int32_t gps_almanac_transfer;
 
 
-  /*
  *  Date Time Transfer
  */
+/*
+ *  Date Time Transfer
+ */
 #define pA600 600
-  COMMON int32_t gps_date_time_transfer;
+COMMON int32_t gps_date_time_transfer;
 
-  /*
  *  FlightBook Transfer Protocol
  */
+/*
+ *  FlightBook Transfer Protocol
+ */
 #define pA650 650
-  /*Not implemented */
+/*Not implemented */
 
-  /*
  *  Position
  */
+/*
+ *  Position
+ */
 #define pA700 700
-  COMMON int32_t gps_position_transfer;
+COMMON int32_t gps_position_transfer;
 
 
-  /*
  *  Pvt
  */
+/*
+ *  Pvt
+ */
 #define pA800 800
-  COMMON int32_t gps_pvt_transfer;
+COMMON int32_t gps_pvt_transfer;
 
-  /*
  * Lap Data Transfer
  */
+/*
+ * Lap Data Transfer
+ */
 #define pA906 906
-  COMMON int32_t gps_lap_transfer;
+COMMON int32_t gps_lap_transfer;
 
-  /*
  * Various fitness related
  */
+/*
+ * Various fitness related
+ */
 #define pA1000 1000
-  COMMON int32_t gps_run_transfer;
+COMMON int32_t gps_run_transfer;
 #define pA1002 1002
-  COMMON int32_t gps_workout_transfer;
+COMMON int32_t gps_workout_transfer;
 #define pA1004 1004
-  COMMON int32_t gps_user_profile_transfer;
+COMMON int32_t gps_user_profile_transfer;
 #define pA1005 1005
-  COMMON int32_t gps_workout_limits_transfer;
+COMMON int32_t gps_workout_limits_transfer;
 #define pA1006 1006
-  COMMON int32_t gps_course_transfer;
+COMMON int32_t gps_course_transfer;
 #define pA1007 1007
-  COMMON int32_t gps_course_lap_transfer;
+COMMON int32_t gps_course_lap_transfer;
 #define pA1008 1008
-  COMMON int32_t gps_course_point_transfer;
+COMMON int32_t gps_course_point_transfer;
 #define pA1009 1009
-  COMMON int32_t gps_course_limits_transfer;
+COMMON int32_t gps_course_limits_transfer;
 #define pA1012 1012
-  COMMON int32_t gps_course_trk_transfer;
+COMMON int32_t gps_course_trk_transfer;
 
-  /*
  * Waypoint D Type
  */
+/*
+ * Waypoint D Type
+ */
 #define pD100 100
 #define pD101 101
 #define pD102 102
 #define pD154 154
 #define pD155 155
 
-  COMMON int32_t gps_rte_type;
-  COMMON int32_t gps_waypt_type;
+COMMON int32_t gps_rte_type;
+COMMON int32_t gps_waypt_type;
 
-  /*
  * Waypoint category types
  */
+/*
+ * Waypoint category types
+ */
 #define pD120 120
-  COMMON int32_t gps_category_type;
+COMMON int32_t gps_category_type;
 
-  /*
  * Rte Header Type
  */
+/*
+ * Rte Header Type
+ */
 #define pD200 200
 #define pD201 201
 #define pD202 202
-  COMMON int32_t gps_rte_hdr_type;
+COMMON int32_t gps_rte_hdr_type;
 
 
-  /*
  * Rte Link Type
  */
+/*
+ * Rte Link Type
+ */
 #define pD210 210
-  COMMON int32_t gps_rte_link_type;
+COMMON int32_t gps_rte_link_type;
 
 
-  /*
  *  Trk Point Type
  */
+/*
+ *  Trk Point Type
+ */
 #define pD300 300
 #define pD301 301
 #define pD302 302
 #define pD303 303
 #define pD304 304
-  COMMON int32_t gps_trk_type;
-  COMMON int32_t gps_run_crs_trk_type;
+COMMON int32_t gps_trk_type;
+COMMON int32_t gps_run_crs_trk_type;
 
 
-  /*
  *  Trk Header Type
  */
+/*
+ *  Trk Header Type
+ */
 #define pD310 310
 #define pD311 311
 #define pD312 312
-  COMMON int32_t gps_trk_hdr_type;
-  COMMON int32_t gps_run_crs_trk_hdr_type;
+COMMON int32_t gps_trk_hdr_type;
+COMMON int32_t gps_run_crs_trk_hdr_type;
 
 
 
-  /*
  * Prx Wpt Type
  */
+/*
+ * Prx Wpt Type
+ */
 #define pD400 400
 #define pD403 403
 #define pD450 450
 
-  COMMON int32_t gps_prx_waypt_type;
+COMMON int32_t gps_prx_waypt_type;
 
 
-  /*
  * Almanac Type
  */
+/*
+ * Almanac Type
+ */
 #define pD500 500
 #define pD501 501
 #define pD550 550
 #define pD551 551
 
-  COMMON int32_t gps_almanac_type;
+COMMON int32_t gps_almanac_type;
 
 
-  /*
  * Date Time Type
  */
+/*
+ * Date Time Type
+ */
 #define pD600 600
 
-  COMMON int32_t gps_date_time_type;
+COMMON int32_t gps_date_time_type;
 
 
 
-  /*
  * Position Type
  */
+/*
+ * Position Type
+ */
 #define pD700 700
 
-  COMMON int32_t gps_position_type;
+COMMON int32_t gps_position_type;
 
 
 
-  /*
  * Pvt Data Type
  */
+/*
+ * Pvt Data Type
+ */
 #define pD800 800
 
-  COMMON int32_t gps_pvt_type;
+COMMON int32_t gps_pvt_type;
 
-  /*
  * Lap Data Type
  */
+/*
+ * Lap Data Type
+ */
 #define pD906 906
 #define pD1001 1001
 #define pD1011 1011
 #define pD1015 1015
 
-  COMMON int32_t gps_lap_type;
+COMMON int32_t gps_lap_type;
 
-  /*
  * Various fitness related
  */
+/*
+ * Various fitness related
+ */
 #define pD1000 1000
 #define pD1009 1009
 #define pD1010 1010
-  COMMON int32_t gps_run_type;
+COMMON int32_t gps_run_type;
 #define pD1002 1002
 #define pD1008 1008
-  COMMON int32_t gps_workout_type;
+COMMON int32_t gps_workout_type;
 #define pD1003 1003
-  COMMON int32_t gps_workout_occurrence_type;
+COMMON int32_t gps_workout_occurrence_type;
 #define pD1004 1004
-  COMMON int32_t gps_user_profile_type;
+COMMON int32_t gps_user_profile_type;
 #define pD1005 1005
-  COMMON int32_t gps_workout_limits_type;
+COMMON int32_t gps_workout_limits_type;
 #define pD1006 1006
-  COMMON int32_t gps_course_type;
+COMMON int32_t gps_course_type;
 #define pD1007 1007
-  COMMON int32_t gps_course_lap_type;
+COMMON int32_t gps_course_lap_type;
 #define pD1012 1012
-  COMMON int32_t gps_course_point_type;
+COMMON int32_t gps_course_point_type;
 #define pD1013 1013
-  COMMON int32_t gps_course_limits_type;
+COMMON int32_t gps_course_limits_type;
 
-  /*
  * Link protocol type
  */
+/*
+ * Link protocol type
+ */
 #define pL000 0
 #define pL001 1
 #define pL002 2
 
-  COMMON int32_t gps_link_type;
-
-
-
-  struct GPS_MODEL_PROTOCOL {
-    US    id;
-    int32_t link;
-    int32_t command;
-    int32_t wayptt;
-    int32_t wayptd;
-    int32_t rtea;
-    int32_t rted0;
-    int32_t rted1;
-    int32_t trka;
-    int32_t trkd;
-    int32_t prxa;
-    int32_t prxd;
-    int32_t alma;
-    int32_t almd;
-  };
-
-  US     GPS_Protocol_Version_Change(US id, US version);
-  COMMON int32_t GPS_Protocol_Table_Set(US id);
-  void   GPS_Protocol_Error(US tag, US data);
-  void   GPS_Unknown_Protocol_Print();
+COMMON int32_t gps_link_type;
+
+
+
+struct GPS_MODEL_PROTOCOL {
+  US    id;
+  int32_t link;
+  int32_t command;
+  int32_t wayptt;
+  int32_t wayptd;
+  int32_t rtea;
+  int32_t rted0;
+  int32_t rted1;
+  int32_t trka;
+  int32_t trkd;
+  int32_t prxa;
+  int32_t prxd;
+  int32_t alma;
+  int32_t almd;
+};
+
+US     GPS_Protocol_Version_Change(US id, US version);
+COMMON int32_t GPS_Protocol_Table_Set(US id);
+void   GPS_Protocol_Error(US tag, US data);
+void   GPS_Unknown_Protocol_Print();
 
 
 #endif // JEEPS_GPSPROT_H_INCLUDED_
index c5937234cf48a7dedc18bc8ac44ab453849e101f..e28287293c710ca062736c7f3d5406739a64b92d 100644 (file)
@@ -4,8 +4,8 @@
 
 #include "jeeps/gps.h"
 
-  time_t GPS_Time_Now();
+time_t GPS_Time_Now();
 int32_t GPS_Serial_Packet_Read(gpsdevh* fd, GPS_Packet* packet);
-  bool GPS_Serial_Get_Ack(gpsdevh *fd, GPS_Packet *tra, GPS_Packet *rec);
+bool GPS_Serial_Get_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
 
 #endif // JEEPS_GPSREAD_H_INCLUDED_
index a4954a9e445f91be1d64273fcb40e93c5ffff912..9c5827124c250530b21d5ab57943d9906b86e1a1 100644 (file)
@@ -7,9 +7,9 @@
 #define GPS_ARB_LEN 1024
 
 int32_t GPS_Serial_Write_Packet(gpsdevh* fd, const GPS_Packet& packet);
-  bool  GPS_Serial_Send_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
+bool  GPS_Serial_Send_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
 
-  void   GPS_Make_Packet(GPS_Packet* packet, US type, UC* data, uint32_t n);
+void   GPS_Make_Packet(GPS_Packet* packet, US type, UC* data, uint32_t n);
 
 
 #endif // JEEPS_GPSSEND_H_INCLUDED_
index 87f47e23d6d9a8b815153aaf7922dca6582e3920..0e50f703a5aed9f84d164f8ccbb9223b17ceb317 100644 (file)
@@ -6,35 +6,35 @@
 
 int32_t GPS_Util_Little();
 
-  US     GPS_Util_Get_Short(const UC* s);
-  void   GPS_Util_Put_Short(UC* s, US v);
+US     GPS_Util_Get_Short(const UC* s);
+void   GPS_Util_Put_Short(UC* s, US v);
 int32_t GPS_Util_Get_Int(const UC* s);
-  void   GPS_Util_Put_Int(UC* s, int32_t v);
-  double GPS_Util_Get_Double(const UC* s);
-  void   GPS_Util_Put_Double(UC* s, double v);
-  float  GPS_Util_Get_Float(const UC* s);
-  void   GPS_Util_Put_Float(UC* s, float v);
-  void   GPS_Util_Canon(int32_t state);
+void   GPS_Util_Put_Int(UC* s, int32_t v);
+double GPS_Util_Get_Double(const UC* s);
+void   GPS_Util_Put_Double(UC* s, double v);
+float  GPS_Util_Get_Float(const UC* s);
+void   GPS_Util_Put_Float(UC* s, float v);
+void   GPS_Util_Canon(int32_t state);
 int32_t GPS_Util_Block(int32_t fd, int32_t state);
-  void   GPS_Util_Put_Uint(UC* s, uint32_t v);
+void   GPS_Util_Put_Uint(UC* s, uint32_t v);
 uint32_t GPS_Util_Get_Uint(const UC* s);
 
-  void   GPS_Warning(const char* s);
-  [[gnu::format(printf, 1, 2)]] void   GPS_Error(const char* fmt, ...);
-  [[gnu::format(printf, 1, 2)]] void   GPS_Serial_Error(const char* fmt, ...);
-  [[noreturn]] void   GPS_Fatal(const char* s);
-  void   GPS_Enable_Error();
-  void   GPS_Enable_Warning();
-  void   GPS_Disable_Error();
-  void   GPS_Disable_Warning();
-  [[gnu::format(printf, 1, 2)]] void   GPS_User(const char* fmt, ...);
-  void   GPS_Disable_User();
-  void   GPS_Enable_User();
-  void   GPS_Diagnose(int32_t c);
-  [[gnu::format(printf, 1, 2)]] void   GPS_Diag(const char* fmt, ...);
-
-  void   GPS_Enable_Diagnose();
-  void   GPS_Disable_Diagnose();
+void   GPS_Warning(const char* s);
+[[gnu::format(printf, 1, 2)]] void   GPS_Error(const char* fmt, ...);
+[[gnu::format(printf, 1, 2)]] void   GPS_Serial_Error(const char* fmt, ...);
+[[noreturn]] void   GPS_Fatal(const char* s);
+void   GPS_Enable_Error();
+void   GPS_Enable_Warning();
+void   GPS_Disable_Error();
+void   GPS_Disable_Warning();
+[[gnu::format(printf, 1, 2)]] void   GPS_User(const char* fmt, ...);
+void   GPS_Disable_User();
+void   GPS_Enable_User();
+void   GPS_Diagnose(int32_t c);
+[[gnu::format(printf, 1, 2)]] void   GPS_Diag(const char* fmt, ...);
+
+void   GPS_Enable_Diagnose();
+void   GPS_Disable_Diagnose();
 
 
 #endif // JEEPS_GPSUTIL_H_INCLUDED_